package net.qunzhi.modules.app.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.qunzhi.common.annotation.SysLog;
import net.qunzhi.common.utils.BaseQuery;
import net.qunzhi.common.utils.PageUtils;
import net.qunzhi.common.utils.R;
import net.qunzhi.modules.app.annotation.Login;
import net.qunzhi.modules.cms.entity.TbEquipmentEntity;
import net.qunzhi.modules.cms.service.TbEquipmentService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;
import java.util.Map;


/**
 * 设备信息
 *
 * @author zjr
 * @date 2021-09-10 15:48:00
 */
@Api(tags = "App设备信息相关")
@RestController
@RequestMapping("app/tbEquipment")
public class AppEquipmentController {
    @Autowired
    private TbEquipmentService tbEquipmentService;

    @ApiOperation("下拉框")
    @Login
    @GetMapping("/combo")
    public R list(){
        List<Map<String, Object>> list = tbEquipmentService
                .listMaps(new QueryWrapper<TbEquipmentEntity>().select("id", "name", "flow_meter_name flowMeterName"));

        return R.ok().put("list", list);
    }

}
